#!/usr/bin/env ruby

LKP_SRC = ENV['LKP_SRC'] || File.direname(File.dirname(File.realpath($PROGRAM_NAME)))

if ENV['RESULT_ROOT']
    fn = File.join ENV['RESULT_ROOT'], 'output'
elsif ARGV[0]
    fn = ARGV[0]
end

contents = File.read(fn).split("\n")

result = /^\/root\/qcow2\/mnt\/(.+)\/(.+)\/(.+)$/.match(contents.last)
if result
    puts ".result.os: #{result[1]}"
    puts ".result.arch: #{result[2]}"
    puts ".result.version: #{result[3]}"
end
